console.log('Server started');

var WebSocketServer = require('ws').Server,
  wss = new WebSocketServer({ port: 8010 });

wss.on('connection', function (ws) {
  ws.on('message', function (message) {
    console.log('Received from client: %s', message);
    ws.send('Server received from client: ' + message);
  });
});
